#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

using namespace std;

typedef long long LL;

const int N = 1e5 + 10;
LL n, k;
LL h[N];
LL s[N];

int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n;i++)  cin >> h[i];
    for (int i = 1; i <= n;i++)  cin >> s[i];

    LL left = 0, right = 0;
    LL hcount = 0, hmax = 0, scount = 0, smin = 0, begin = 0;

    while (right <= n)
    {
        hcount += h[right];
        scount += s[right];
        while (right - left + 1 > k)
        {
            hcount -= h[left];
            scount -= s[left];
            left++;
        }
        if (right - left + 1 == k)
        {
            if (hcount > hmax)
            {
                begin = left;
                hmax = hcount;
                smin = scount;
            }
            else if (hcount == hmax && scount < smin)
            {
                begin = left;
                hmax = hcount;
                smin = scount;
            }
        }
        right++;
    }

    cout << begin << endl;
    return 0;
}